home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / sun / font / GlyphLayout$GVData.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  1.5 KB  |  113 lines

  1. package sun.font;
  2.  
  3. import java.awt.Font;
  4. import java.awt.font.FontRenderContext;
  5. import java.awt.geom.AffineTransform;
  6.  
  7. public final class GlyphLayout$GVData {
  8.    public int _count;
  9.    public int _flags;
  10.    public int[] _glyphs;
  11.    public float[] _positions;
  12.    public int[] _indices;
  13.    private static final int UNINITIALIZED_FLAGS = -1;
  14.  
  15.    public void init(int var1) {
  16.       this._count = 0;
  17.       this._flags = -1;
  18.       if (this._glyphs == null || this._glyphs.length < var1) {
  19.          if (var1 < 20) {
  20.             var1 = 20;
  21.          }
  22.  
  23.          this._glyphs = new int[var1];
  24.          this._positions = new float[var1 * 2 + 2];
  25.          this._indices = new int[var1];
  26.       }
  27.  
  28.    }
  29.  
  30.    public void grow() {
  31.       this.grow(this._glyphs.length / 4);
  32.    }
  33.  
  34.    public void grow(int var1) {
  35.       int var2 = this._glyphs.length + var1;
  36.       int[] var3 = new int[var2];
  37.       System.arraycopy(this._glyphs, 0, var3, 0, this._count);
  38.       this._glyphs = var3;
  39.       float[] var4 = new float[var2 * 2 + 2];
  40.       System.arraycopy(this._positions, 0, var4, 0, this._count * 2 + 2);
  41.       this._positions = var4;
  42.       int[] var5 = new int[var2];
  43.       System.arraycopy(this._indices, 0, var5, 0, this._count);
  44.       this._indices = var5;
  45.    }
  46.  
  47.    public void adjustPositions(AffineTransform var1) {
  48.       var1.transform(this._positions, 0, this._positions, 0, this._count);
  49.    }
  50.  
  51.    public StandardGlyphVector createGlyphVector(Font var1, FontRenderContext var2, StandardGlyphVector var3) {
  52.       if (this._flags == -1) {
  53.          this._flags = 0;
  54.          if (this._count > 1) {
  55.             boolean var4 = true;
  56.             boolean var5 = true;
  57.             int var6 = this._count;
  58.  
  59.             for(int var7 = 0; var7 < this._count && (var4 || var5); ++var7) {
  60.                boolean var10000;
  61.                label54: {
  62.                   int var8 = this._indices[var7];
  63.                   var4 = var4 && var8 == var7;
  64.                   if (var5) {
  65.                      --var6;
  66.                      if (var8 == var6) {
  67.                         var10000 = true;
  68.                         break label54;
  69.                      }
  70.                   }
  71.  
  72.                   var10000 = false;
  73.                }
  74.  
  75.                var5 = var10000;
  76.             }
  77.  
  78.             if (var5) {
  79.                this._flags |= 4;
  80.             }
  81.  
  82.             if (!var5 && !var4) {
  83.                this._flags |= 8;
  84.             }
  85.          }
  86.  
  87.          this._flags |= 2;
  88.       }
  89.  
  90.       int[] var9 = new int[this._count];
  91.       System.arraycopy(this._glyphs, 0, var9, 0, this._count);
  92.       float[] var10 = null;
  93.       if ((this._flags & 2) != 0) {
  94.          var10 = new float[this._count * 2 + 2];
  95.          System.arraycopy(this._positions, 0, var10, 0, var10.length);
  96.       }
  97.  
  98.       int[] var11 = null;
  99.       if ((this._flags & 8) != 0) {
  100.          var11 = new int[this._count];
  101.          System.arraycopy(this._indices, 0, var11, 0, this._count);
  102.       }
  103.  
  104.       if (var3 == null) {
  105.          var3 = new StandardGlyphVector(var1, var2, var9, var10, var11, this._flags);
  106.       } else {
  107.          var3.initGlyphVector(var1, var2, var9, var10, var11, this._flags);
  108.       }
  109.  
  110.       return var3;
  111.    }
  112. }
  113.